package interfaces;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JEditorPane;
import javax.swing.JLabel;
import javax.swing.SwingConstants;


public class aboutGame extends MyPanel implements ActionListener{
	private MainWindow mainWin;
	public aboutGame(MainWindow win)
	{
		super();
		mainWin=win;
		
		//calculate position of GUI components
		int w=win.getWidth();
		int h=win.getHeight();
		int button_w=w/3;
		int button_h=h/9;
		int space_x=w/3;
		int space_y=0;
		int padd_y=h/5;
		String html="<font face=\"Bookman Old Style, Book Antiqua, Garamond\"><ul ><strong>About Game</strong><li>Game Type:Guess</li><li>Platform: PC</li><li>Mode: Single Player</li></ul><ul><strong>About Arthor</strong><li>Nguyễn Anh Tuấn</li><li>Đào Trọng Hiếu</li><li>Nguyễn Đình Phong</li></ul></font><body>";
		
		//create GUI components and add into specified position
		JLabel titleLabel=new JLabel("");
		titleLabel.setHorizontalAlignment(SwingConstants.CENTER);
		titleLabel.setFont(new Font("Hand of Sean", Font.BOLD, 48));
		titleLabel.setOpaque(false);
		titleLabel.setForeground(Color.green);
		titleLabel.setText("GUESS PEOPLE!");
		titleLabel.setBounds(0,0,w,padd_y);
		this.add(titleLabel);
		
		JLabel titleLabel2=new JLabel("");
		titleLabel2.setHorizontalAlignment(SwingConstants.CENTER);
		titleLabel2.setFont(new Font("Hand of Sean", Font.BOLD, 20));
		titleLabel2.setOpaque(false);
		titleLabel2.setForeground(Color.green);
		titleLabel2.setText("Guest who in hedspi?");
		titleLabel2.setBounds(0,padd_y-10,w,padd_y/4);
		this.add(titleLabel2,BorderLayout.NORTH);
		
		JEditorPane htmlPane = new JEditorPane();
		htmlPane.setEditable(false);
		htmlPane.setContentType("text/html");
		htmlPane.setText(html);
		htmlPane.setBounds(w/10, padd_y*5/4+20, w, h/2);
		this.add(htmlPane);
		
		JButton backButton=new JButton("Back");
		backButton.setPreferredSize(new Dimension(100, 30));
		backButton.addActionListener(this);
		Container con2=new Container();
		con2.setLayout(new FlowLayout());
		con2.add(backButton);
		con2.setBounds(0, h-100, w, 35);
		this.add(con2);
	}
	@Override
	public void actionPerformed(ActionEvent arg0) 
	{
	 mainWin.changeScreen(new mainMenuScreen(mainWin));	
	}
}
